<template>
  <el-menu :default-active="$route.path" class="JJMenu" :collapse="store.state.sidebar.isCollapse" :collapse-transition="false" router>
    <el-menu-item index="/">Home</el-menu-item>
    <el-submenu index="P0">
      <template slot="title">
        <i class="el-icon-folder"></i>
        <span slot="title">P0 Menu</span>
      </template>
      <el-menu-item-group title="Group 1">
        <el-menu-item index="/P0/O1">Option - 1</el-menu-item>
        <el-menu-item index="/P0/O2">Option - 2</el-menu-item>
      </el-menu-item-group>
      <el-menu-item-group title="Group 2">
        <el-menu-item index="/P0/O3">Option - 3</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
    <el-submenu index="P1">
      <template slot="title">
        <i class="el-icon-folder"></i>
        <span slot="title">P1 Menu</span>
      </template>
      <el-menu-item-group title="Group 1">
        <el-menu-item index="2-1">Option - 1</el-menu-item>
        <el-menu-item index="2-2">Option - 2</el-menu-item>
      </el-menu-item-group>
      <el-menu-item-group title="Group 2">
        <el-menu-item index="2-3">Option - 3</el-menu-item>
        <el-menu-item index="2-3">Option - 4</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
  </el-menu>
</template>

<script>
import store from '../store'
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'JJMenu',
  data() {
    return {
      store
    }
  }
})
</script>

<style lang="scss">
.JJMenu {
  height: 100%;
}
</style>
